/**
 * 
 */
package cn.osworks.aos.builder;

import java.sql.Connection;
import java.sql.SQLException;

import cn.osworks.aos.builder.asset.DriverManagerOpt;
import cn.osworks.aos.builder.metainfo.DBMetaInfoUtils;
import cn.osworks.aos.core.dao.asset.DBType;
import cn.osworks.aos.core.typewrap.Dto;
import cn.osworks.aos.core.typewrap.Dtos;

/**
 * @author penghe
 *
 */
public class VCBuliderConsole {

	/**
	 * @param args
	 * @throws SQLException 
	 */
	public static void main(String[] args) throws SQLException {
		DriverManagerOpt driverOpt = new DriverManagerOpt();
		//当前版本支持mysql、oracle、sqlserver2005+、H2
		driverOpt.setDataBaseType(DBType.MYSQL); 
		driverOpt.setIp("127.0.0.1");
		driverOpt.setPort("3306");
		//数据库名或数据库实例名
		//driverOpt.setCatalog("./webapp/WEB-INF/db/aos");
		driverOpt.setCatalog("aos");
		driverOpt.setUserName("root");
		driverOpt.setPassword("password");
		Connection connection = DBMetaInfoUtils.newConnection(driverOpt);
		Dto dto = Dtos.newDto();
		dto.put("outPath", "/j2eewok/aos/aos/aos/src/aos/java/cn/core/test/");
		dto.put("outJSPPath", "/j2eewok/aos/aos/aos/webapp/WEB-INF/jsp/test/");
		dto.put("package", "cn.core.test.modules");
		dto.put("daopackage", "cn.core.test.dao");
		dto.put("servicepackage", "cn.core.test.modules.service");
		dto.put("controllername", "test");
		dto.put("author", "hepeng");  
		dto.put("tables", "co_test");
		VCBuilder.build(connection, dto);
	}

}
